package hadoop.mapreduce.partitionsort;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;


public class PhoneReducer extends Reducer <PhoneBean,Text,Text,Text>{
    // key                          values
    //{phoneBean{2481,24681,27162},{13736230513,13836230514}}
    @Override
    protected void reduce(PhoneBean key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
        for (Text phone : values) {
            context.write(phone,new Text(key.toString()));
        }
    }
}
